using System;
using System.Collections.Generic;
using System.Text;

namespace XnaDevRu.BulletX
{
	/// <summary>
	/// EmptyAlgorithm is a stub for unsupported collision pairs.
	/// The dispatcher can dispatch a persistent btEmptyAlgorithm to avoid a search every frame.
	/// </summary>
	public class EmptyAlgorithm : CollisionAlgorithm
	{
		public EmptyAlgorithm(CollisionAlgorithmConstructionInfo collisionAlgorithmConstructionInfo)
			: base(collisionAlgorithmConstructionInfo) { }

		public override void ProcessCollision(CollisionObject bodyA, CollisionObject bodyB, DispatcherInfo dispatchInfo, ManifoldResult resultOut) { }

		public override float CalculateTimeOfImpact(CollisionObject bodyA, CollisionObject bodyB, DispatcherInfo dispatchInfo, ManifoldResult resultOut)
		{
			return 1f;
		}

		public class CreateFunc : CollisionAlgorithmCreateFunction
		{
			public override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo collisionAlgorithmConstructionInfo, CollisionObject bodyA, CollisionObject bodyB)
			{
				return new EmptyAlgorithm(collisionAlgorithmConstructionInfo);
			}
		};
	}
}
